package com.zhengxiang.onlinexamination.controller;



import com.baomidou.mybatisplus.extension.api.ApiController;
import com.zhengxiang.onlinexamination.base.AjaxResult;
import com.zhengxiang.onlinexamination.entity.vo.SysRoleVo;
import com.zhengxiang.onlinexamination.service.SysRoleService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 角色(SysRole)表控制层
 *
 * @author 
 * @since 2023-03-11 10:23:24
 */
@RestController
@RequestMapping("sysRole")
public class SysRoleController extends ApiController {
    /**
     * 服务对象
     */
    @Resource
    private SysRoleService sysRoleService;

        /**角色列表*/
    @GetMapping("/queryAll")
    public AjaxResult queryAll(SysRoleVo sysRoleVo){
        return AjaxResult.success (sysRoleService.queryAll(sysRoleVo));
    }

    @PostMapping("/saveRole")
    public AjaxResult saveRole(@RequestBody SysRoleVo sysRoleVo){
        sysRoleService.saveRole(sysRoleVo);
        return AjaxResult.success();
    }

    @PostMapping("/delRole")
    public AjaxResult delRole(@RequestBody SysRoleVo sysRoleTo){
        return AjaxResult.success();
    }
}

